package com.press.services;

import com.press.bean.UserBean;
import com.press.mapper.LoginMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by haocongshun on 2016/10/5.
 */
@Service("loginService")
public class LoginService {
    @Resource(name = "loginMapper")
    private LoginMapper loginMapper;

    public LoginMapper getLoginMapper() {
        return loginMapper;
    }

    public void setLoginMapper(LoginMapper loginMapper) {
        this.loginMapper = loginMapper;
    }

    public UserBean adminLogin(String username, String password){
        Map<String,String> admin = new HashMap<>();
        admin.put("username",username);
        admin.put("password",password);
        return loginMapper.adminLogin(admin);
    }
}
